//
//  HJDataInputStream.h
//  BJH
//
//  Created by xtjun on 2023/10/14.
//

#import <Foundation/Foundation.h>
#import "NSData+Byte.h"

NS_ASSUME_NONNULL_BEGIN


//接收的数据类型必须对于上, 如果正数请使用在前面加u
@interface HJDataInputStream : NSObject

@property (nonatomic, strong, readonly) NSData *data;
@property (nonatomic, assign, readonly) NSInteger readLength;

- (HJDataInputStream *)initWithData:(NSData *)data;
- (NSData *)readDataWithLength:(int)length;
- (nullable NSData *)readRemainingData;
- (int32_t)readValueWithLength:(int)length;
- (int8_t)readChar;
- (int16_t)readShort;
- (int32_t)readInt;
- (int64_t)readLong;

@end

NS_ASSUME_NONNULL_END
